package text111;

public class Solution16 {
	  public int fib(int n) {
	       	int f1 = 0,f2 = 1,i = 2;
			  	int fn = 0 ;
	            if(n==0) return f1;
	            if(n==1) return f2;
	 		  	while(i<=n) {
			  		fn = (f1 + f2)%1000000007;
			  		f1 = f2;
			  		f2 = fn;
	                i++;
			  	}
			  	return fn;
	    }
}
